String[] list = new String[3];
list[3] = "dog" ;

A good answer might be:

An ArrayIndexOutOfBounds exception is thrown and (ordinarily) the program halts.

Vector class

The Vector class builds upon the capabilities of arrays. A Vector object contains an array of object references plus many methods for managing that array. The biggest convenience of a Vector is that you can keep adding elements to it no matter what size it was originally. The size of the Vector will automatically increase and no information will be lost.

However, this convenience comes at a price:

  1. The elements of a Vector are object references, not primitive data like int or double.
  2. Using a Vector is slighly slower than using an array directly.
  3. The elements of a Vector are references to Object. This means that often you will need to use type casting with the data from a Vector.

QUESTION 4:

(Review: ) What is the Object class?